# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=m17n-db
pkgver=1.8.8
pkgrel=0
# the i18n/charmaps are in the glibc source
_glibc=2.37
pkgdesc="gnu M-text multilingualization data"
url="https://www.nongnu.org/m17n/"
arch="noarch"
license="LGPL-2.1-or-later"
# FIXME: bb awk hangs
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="mawk gettext-dev"
subpackages="$pkgname-lang $pkgname-dev"
source="https://download.savannah.gnu.org/releases/m17n/m17n-db-$pkgver.tar.gz
	glibc-$_glibc.tar.xz::https://ftp.gnu.org/gnu/glibc/glibc-$_glibc.tar.xz
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-charmaps="$srcdir"/glibc-$_glibc/localedata/charmaps/ \
		AWK=mawk
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -vp "$pkgdir"/usr/lib
	mv -v "$pkgdir"/usr/share/pkgconfig "$pkgdir"/usr/lib/
}

sha512sums="
00a041ffb8b673fbd0ca40d58e97828d70636da57e14f460bff6b29c0f524672503d38bab985efe0412c2ac05911f1ab757f5d9a0378c64f29b4d71629a96aec  m17n-db-1.8.8.tar.gz
4fc5932f206bb1b8b54828a28af1a681616b838bbab60c81c82155f3629cbfe1301d271af65511ed917f4c6949a025429221fe6035753282f15346919f15b90c  glibc-2.37.tar.xz
"
